# -*- coding: utf-8 -*-
# Houdini To Arnold
# Copyright (C) 2013 Erkan Ozgur Yilmaz
#
# This file is part of Houdini To Arnold.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation;
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA

from ArnoldBase import Base


class Option(Base):
    """Defines generic options
    """

    __prefix__ = 'options'

    def __init___(self, **kwargs):
        super(Option, self).__init__(**kwargs)

    def to_ass(self):
        template = """options
{
 name options
 AA_samples 3
 AA_seed 1
 AA_sample_clamp_affects_aovs off
 threads 0
 abort_on_error on
 abort_on_license_fail off
 skip_license_check off
 error_color_bad_texture 1 0 0
 error_color_bad_pixel 0 0 1
 outputs 
  "RGBA RGBA defaultArnoldFilter@gaussian_filter defaultArnoldDriver@driver_exr.RGBA" 
 xres %(xres)i
 yres %(yres)i
 region_min_x -1
 region_min_y -1
 region_max_x -1
 region_max_y -1
 aspect_ratio %(aspect)f
 bucket_size 64
 bucket_scanning "spiral"
 ignore_textures off
 ignore_shaders off
 ignore_atmosphere off
 ignore_lights off
 ignore_shadows off
 ignore_mis off
 ignore_subdivision off
 ignore_displacement off
 ignore_bump off
 ignore_motion_blur off
 ignore_dof off
 ignore_smoothing off
 ignore_sss off
 auto_transparency_depth 10
 auto_transparency_threshold 0.99000001
 texture_max_open_files 512
 texture_max_memory_MB 1024
 texture_per_file_stats off
 texture_searchpath "/home/eoyilmaz/maya/projects/default/sourceimages"
 texture_automip on
 texture_autotile 64
 texture_accept_untiled on
 texture_accept_unmipped on
 texture_conservative_lookups on
 texture_glossy_blur 0
 texture_diffuse_blur 0.03125
 texture_max_sharpen 1.5
 camera "%(cameraName)s"
 background NULL
 atmosphere NULL
 low_light_threshold 0.00100000005
 shadow_terminator_fix on
 sss_sample_factor 4
 sss_bssrdf_samples 3
 volume_indirect_samples 0
 sss_subpixel_cache on
 show_samples "off"
 physically_based on
 reference_time 0
 shader_nan_checks off
 max_subdivisions 999
 procedural_searchpath ""
 shader_searchpath ""
 preserve_scene_data off
 texture_gamma 2.20000005
 light_gamma 2.20000005
 shader_gamma 2.20000005
 GI_diffuse_depth 1
 GI_glossy_depth 1
 GI_reflection_depth 2
 GI_refraction_depth 2
 GI_total_depth 10
 GI_diffuse_samples 2
 GI_glossy_samples 2
 GI_refraction_samples 2
 enable_aov_composition off
 binary_ass %(binary_ass)s
 declare frame constant FLOAT
 frame 1
 declare fps constant FLOAT
 fps 24
}
"""
        return template % self.params
